package com.zhuss.controller.core;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.zhuss.bean.bo.core.information.CreateInformationBo;
import com.zhuss.bean.bo.core.information.DeleteInformationBo;
import com.zhuss.bean.bo.core.information.UpdateInformationBo;
import com.zhuss.bean.bo.core.information.StartInformationBo;
import com.zhuss.bean.bo.core.information.StopInformationBo;
import com.zhuss.common.BaseController;
import com.zhuss.common.OperateService;
import com.zhuss.core.information.InformationOperateServiceExt;
import com.zhuss.exception.DzcxException;


/**
 * @description: 通知公告操作的Controller
 * @author: zhushanshuo
 * @create: Tue Feb 02 15:16:28 CST 2021
 **/
@RestController
@RequestMapping("/information")
public class InformationOperateController extends BaseController {
	
	@Autowired
	@Qualifier("informationOperateService")
	private OperateService<Void, Object> informationOperateService;
	
	@Autowired
	@Qualifier("informationOperateServiceExt")
	private InformationOperateServiceExt informationOperateServiceExt;
	
	/**
	 * 创建
	 * @param bo
	 * @throws DzcxException
	 */
	@ResponseBody
    @PostMapping("/create")
    public void create(@RequestBody CreateInformationBo bo) throws DzcxException {
		
		informationOperateService.create(bo);
    }
	
	
	/**
	 * 修改
	 * @param bo
	 * @throws DzcxException
	 */
	@ResponseBody
    @PostMapping("/update")
    public void update(@RequestBody UpdateInformationBo bo) throws DzcxException {
		
		informationOperateService.update(bo);
    }
	
	/**
	 * 删除
	 * @param bo
	 * @throws DzcxException
	 */
	@ResponseBody
    @PostMapping("/delete")
    public void delete(@RequestBody DeleteInformationBo bo) throws DzcxException {
		
		informationOperateService.delete(bo);
    }
	
	/**
	 * 启用
	 * @param bo
	 * @throws DzcxException
	 */
	@ResponseBody
    @PostMapping("/start")
    public void start(@RequestBody StartInformationBo bo) throws DzcxException {
		
		informationOperateServiceExt.start(bo);
    }
	
	
	/**
	 * 停用
	 * @param bo
	 * @throws DzcxException
	 */
	@ResponseBody
    @PostMapping("/stop")
    public void stop(@RequestBody StopInformationBo bo) throws DzcxException {
		
		informationOperateServiceExt.stop(bo);
    }
	
}
